<script>
function addLine(){
	var cloneLine = $("#cloneTr").clone();
	$("#tableBody").prepend(cloneLine);
}
function removeLine(ctr){
	$(ctr).parent().parent().remove();
}

</script>
<form method="post" action="admin/tradestrategy/add" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
<div class="pageHeader">
	<table>
		<tr>
			<td>商户：</td>
			<td>
				<input type="hidden" name="merchCode" value=""/>
				<input type="text" name="merchName" class="required" suggestFields="merchName,merchCode"  />
			</td>
			<td>
				<a class="btnLook" href="admin/merch/lookup" lookupGroup="">查找带回</a>
			</td>
			<td>&emsp;渠道：</td>
			<td>
				<select class="combox required" name="channelCode">
                      #for(channel:channelList)
                          <option value="#(channel.code )" id="#(channel.channelMerchCode )" >#(channel.code )-#(channel.name )</option>
                      #end
                 	</select> 
			</td>
		</tr>
	</table>
</div>

<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
				<li><a class="add" href="javascript:addLine()"><span>添加行</span></a></li>
		</ul>
	</div>
	<div id="w_list_print">
	<table class="list" style="width: 98%" targetType="navTab" asc="asc" desc="desc" layoutH="100">
		<thead>
			<tr>
				<th width="80">支付类别</th>
				<th width="100">商户费率</th>
				<th width="100">风控规则</th>
				<th width="100">子商户号</th>
				<th width="100">操作</th>
			</tr>
		</thead>
		<tbody id="tableBody">
			
		</tbody>
	</table>
	</div>
	  <div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>
</div>
</form>
		<table style="display: none">
			<tr id="cloneTr">
				<td>
					<select  name="payType">
	                     #for(payType:payTypeList)
	                          <option value="#(payType.code )">#(payType.code )-#(payType.name )</option>
	                     #end
	                 </select> 
				</td>
				<td>
					<select  name="merchFeeId">
	                    #for(feeModel:feeModelList)
	                        <option value="#(feeModel.id )" >#(feeModel.name )</option>
	                    #end
	                </select> 
				</td>
				<td>
					<select  name="riskRuleId">
	                       #for(riskRule:riskRuleList)
	                           <option value="#(riskRule.id )">#(riskRule.name )</option>
	                       #end
	                  </select> 
				</td>
				<td>
					<input type="text" name="channelSubMerchCode"/>
				</td>
				<td>
					<a  href="javascript:;" onclick="removeLine(this)" >
	               		<i class="fa fa-times"></i>删除行
	               	</a>
				</td>
			</tr>
		</table>
